package it.uniroma2.art.coda.structures;

import it.uniroma2.art.owlart.model.ARTNode;

/**
 * This class can contain an ARTNode or a String
 * 
 * @author Andrea Turbati
 * 
 */
public class ARTNodeAndString {
	private ARTNode artNode;
	private String string;

	/**
	 * @param artNode
	 *            the ARTNode that this instance will contain
	 */
	public ARTNodeAndString(ARTNode artNode) {
		this.artNode = artNode;
		string = null;
	}

	/**
	 * @param string
	 *            the string this instance will contain
	 */
	public ARTNodeAndString(String string) {
		artNode = null;
		this.string = string;
	}

	/**
	 * check if this instance contains an ARTNode or a String
	 * 
	 * @return true if it contains an ARTNode, false otherwise (it contains a String)
	 */
	public boolean isARTNodeSet() {
		return (artNode != null);
	}

	/**
	 * Get the ARTNode. Should be used only if {@link #isARTNodeSet()} returns true
	 * 
	 * @return the ARTNode or null if it contains a String
	 */
	public ARTNode getArtNode() {
		return artNode;
	}

	/**
	 * Get the String contiend in this instance. Should be used only if {@link #isARTNodeSet()} returns false
	 * 
	 * @return the STring or null if it contains an ARTNode
	 */
	public String getString() {
		return string;
	}

}
